package com.lsj.text;

import com.lsj.javabean.User;
import mapper.UserMapper;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class text {
    SqlSession session;
    UserMapper mapper;
    @Before
    public void before(){
        SqlSessionFactory factory = MyBatisUtil.getSqlSessionFactory();
        session = factory.openSession(true);
        mapper = session.getMapper(UserMapper.class);
    }
    @After
    public void after(){
        session.close();
    }
    @Test
    public void selectById(){
        User users = mapper.selectById(1);
        System.out.println(users);

    }
    @Test
    public void deleteByArray(){
        int[] ids={1,2};
        mapper.deleteByArray(ids);
    }
}
